package com.cjhedu.web.exception;

import com.cjhedu.web.utils.MyResponseResult;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @author 陈佳豪
 * @version 1.0
 * 全局统一异常处理
 */
@RestControllerAdvice
public class GlobalExceptionHandler {
    @ExceptionHandler(Exception.class)
    public MyResponseResult<String> deMyException(Exception e) {
        e.printStackTrace();
        return MyResponseResult.error("亲，不要慌，服务器正在升级~");

    }
}
